jQuery(function ($) {
    $('.contact').click(function(){
        $('#mask').show();
        $('#dialog').show()
    });
    $('.close_mading').click(function () {
        $('#mask').hide();
        $('#dialog').hide()

    });
    var goodsId = window.location.search.split('=')[1];
    var param={
        requestId:goodsId
    };
    send_ajax('get', '/api/order/getRequestById', param, function callback(res) {
        if(res.code==200&&res.data){
            var data = res.data;
            console.log(data)
            if(data.street){
                data.addr = data.street
            }else if(data.distrit){
                data.addr = data.distrit
            }else if(data.city){
                data.addr = data.city
            }else if(data.province){
                data.addr = data.province
            }
            var pur_address = (data.province?data.province:'')+(data.city?data.city:'')+(data.distrit?data.distrit:'')+(data.street?data.street:'')
            $('#title').html(data.title);
            $('#location').append('<span>'+data.title+'</span>')
            $('.pur_num').html(data.count+data.unit_name);
            $('.pur_place').html(data.addr);
            $('.pur_addr').html(pur_address);
            $('.phone').html('+86'+'&nbsp'+(data.phone?data.phone:''))
            $('.pur_name').html(data.nickname+'简介');
            $('.good_list').html(data.content)
        }
    });
   
});